home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-07-12 | 2.2 KB | 52 lines | [TEXT/GEOL] |
- Item 3925708 2-July-89 22:27
-
- From: KNEPPER Knepper, Christopher
-
- To: MCDONOUGH McDonough, Thomas
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: Re: Opening under…
-
- Tom,
-
- Knowing more about how MF tricks an app to open a doc while it's running might
- help your debugging efforts. Basically, when the app is already running and the
- user tries to open one of its doc's from the Finder, MF tricks app's into
- opening their doc's by patching several traps and posting an event.
-
- First, MF patches out SFGetFile and MenuSelect. Then MF switches in the app and
- posts a mouseDown in the menubar. When the app gets the mouseDown in the
- menubar, the app's main event loop calls MenuSelect. MF's patch to MenuSelect
- immediately returns (the user never sees MenuSelect's user interface, ie. menus
- being displayed). The MenuSelect patch informs the app's main event loop that
- the user selected "Open" (or "Open Collection" - whatever is specified in the
- MSTR resource). At this point, MF removes its MenuSelect patch. The app's main
- event loop next calls SFGetFile. However, MF's patch to SFGetFile immediately
- returns (the user never sees SFGetFile's user interface, ie. a get file dialog
- box). The SFGetFile patch informs the app's main event loop that the user
- selected the file that was opened from the Finder. At this point, MF removes
- its SFGetFile patch.
-
- The app now knows everything necessary to open the file that was opened from
- the Finder.
-
- The reason I explain this is that there might be some custom processing in your
- main event loop that might interfere with MF's tricks. If you override any of
- the following, you should probably check your methods carefully:
-
- PROCEDURE TApplication.DispatchEvent(VAR theEventInfo: EventInfo;
- VAR commandToPerform: TCommand);
- PROCEDURE TApplication.HandleEvent(VAR theEvent: EventRecord);
- PROCEDURE TApplication.MainEventLoop;
- FUNCTION TApplication.GetEvent(eventMask: INTEGER; sleep: LONGINT;
- cursorRgn: RgnHandle;
- VAR anEvent: EventRecord): BOOLEAN;
- FUNCTION TApplication.HandleMouseDown(VAR theEventInfo: EventInfo):
- TCommand;
-
- Good luck,
- -Chris
-
-
-